package com.ms.auto.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import com.auto.AutoConfig;

@Configuration
public class ConsConfig {

    @Autowired
    private Environment env;
	
	@Bean
	public AutoConfig autoConfig() {
		AutoConfig cons = new AutoConfig();
		AutoConfig.clientId = env.getProperty("project.client.id");
		AutoConfig.clientToken = env.getProperty("project.sercret");
		AutoConfig.monitorHost = env.getProperty("monitor.host");

		AutoConfig.upgradeFilePath = env.getProperty("upgrade.file.path");
		AutoConfig.serviceFilePath = env.getProperty("service.file.path");
		
		return cons;
	}
}
